register ucsb.appscale.protoBuff.jar
register /root/software/apache-cassandra-0.7.4-src/lib/commons-lang-2.4.jar
register /root/software/apache-cassandra-0.7.4-src/lib/libthrift-0.5.jar
register /root/appscale/AppServer_Java/appengine-java-sdk-repacked/lib/impl/appengine-api.jar
register /root/software/apache-cassandra-0.7.4-src/lib/google-collections-1.0.jar

/*
user {name, city, state, sex}
logAction {user, action, timespan, sourceIp}
query: select sourceIp, action from logAction where timespan>1;
*/

rows = LOAD 'cassandra://log_10/Standard1' USING org.apache.cassandra.hadoop.pig.CassandraStorage();
logRows = filter rows by $0 matches 'actionlogtests___LogAction.*';
logs = foreach logRows generate ucsb.appscale.protoBuff.Parse($1);
fields = foreach logs generate $0#'sourceIp' as sourceIp, $0#'action' as action, $0#'timespan' as timespan;
result = filter fields by (float)timespan>1;
store result into 'log10Filter' USING PigStorage ('*');
